import request from "@/utils/request";

// 查询管理员表列表
export function listAdmin(query) {
  return request({
    url: "/admin/list",
    method: "get",
    params: query,
  });
}

// 查询管理员表详情
export function getAdmin(userId) {
  return request({
    url: "/admin/" + userId,
    method: "get",
  });
}

// 新增管理员表
export function addAdmin(data) {
  return request({
    url: "/admin",
    method: "post",
    data: data,
  });
}

// login
export function login(data) {
  return request({
    url: "/admin/login",
    method: "post",
    data: data,
  });
}

// 修改管理员表
export function updateAdmin(data) {
  return request({
    url: "/admin",
    method: "put",
    data: data,
  });
}

// 删除管理员表
export function deleteAdmin(userId) {
  return request({
    url: "/admin/" + userId,
    method: "delete",
  });
}
